#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio> 
using namespace std;
int main()
{ 
 	long long n,m,t;
 	cin >> n >> m >> t;
 	int a = m%n;
 	if (m==1 && n==1 && t==1)
 		cout << 1 << endl;
 	else if((0==(a+t-1)%n))	
 		cout << n;
 	else 
		cout << (a+t-1)%n << endl ;
 

 return 0;
}
